package com.teampuzzle;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;

public class Puzzle {
	
	public int pState;
	public static final int STATE_INTRODUCTION = 1;
    public static final int STATE_REMEMBER = 2;
    public static final int STATE_ANSWER = 3;
    public Paint introTextPaint;
	public float scoreTime;

    
	public Puzzle(){
		pState = STATE_INTRODUCTION;
		introTextPaint = new Paint();
		introTextPaint.setARGB(255, 255, 165, 0);
		introTextPaint.setAntiAlias(true);
		introTextPaint.setTextSize(25);
		
		scoreTime = 5.0f;
	}
    
	public void draw(Canvas canvas){		
	}
	

	public void drawText(Canvas canvas, String i, String s, boolean c){
		Paint text = new Paint();
		text.setFakeBoldText(true);
		text.setAntiAlias(true);
		text.setTextSize(25);
		if(c){
			text.setARGB(255, 247, 161, 47);
		}else{
			text.setARGB(255, 62, 206, 206);
		}
		
			canvas.drawText(i, GameThread.paddingLeft-10 ,GameThread.paddingTop, text);
			text.setARGB(255, 172, 178, 198);
			
			canvas.drawText(s, GameThread.paddingLeft-10, GameThread.paddingTop+30, text);
		
	}
	
	public void drawEnd(Canvas canvas){
		Paint endPaint = new Paint();
		endPaint.setARGB(255, 255, 255, 0);
		endPaint.setTextSize(20);
		endPaint.setAntiAlias(true);
		
		canvas.drawText("You failed. Play again?", 80, 80, endPaint);
	}
	
	public void update(){	
	}
	
	public void init(){
		
	}
	
	public int calculateScore(float puzzleTime){
		if(puzzleTime >= 13.0f){
			return 100;
		}
		else{
			return (int) ((int) 100*(puzzleTime/13.0f));
		}
	}
	
	public float getTimeAdd(){
		return 4.0f;
	}
	
	//Hantera sk�rmtryckningar
	public void handleActionDown(int eventX, int eventY){
		
	}

	public void loadContent(Context mContext) {
		// TODO Auto-generated method stub
		
	}
}
